const mongoose = require('mongoose')

// 日计划model
const dayplanSchema = mongoose.Schema({
  userId: Number,
  userName: String,
  deptId: Number, // 部门id
  userEmail: String,
  createTime: String,
  updataTime: String,
  tasks: Array,
  question: String
})
// 周计划model
const weekplanSchema = mongoose.Schema({
  userId: Number,
  userName: String,
  userEmail: String,
  deptId: Number, // 部门id

  createTime: String,
  startTime: String,
  endTime: String,
  updataTime: String,
  tasks: Array,
  question: String
})
// 月度计划model
const monthplanSchema = mongoose.Schema({
  userId: Number,
  userName: String,
  userEmail: String,
  deptId: Number, // 部门id
  createTime: String,
  startTime: String,
  endTime: String,
  updataTime: String,
  tasks: Array,
  question: String
})
// 季度目标
const quarterObjectiveSchema = mongoose.Schema({
  userId: Number,
  userName: String,
  userEmail: String,
  deptId: Number, // 部门id
  createTime: String,
  startTime: String,
  endTime: String,
  updataTime: String,
  tasks: Array,
  question: String
})
// 年度目标
const yearObjectiveSchema = mongoose.Schema({
  userId: Number,
  userName: String,
  userEmail: String,
  deptId: Number, // 部门id
  createTime: String,
  startTime: String,
  endTime: String,
  updataTime: String,
  tasks: Array,
  question: String
})
module.exports = {
  dayplanSchema: mongoose.model('dayPlans', dayplanSchema, 'dayPlans'),
  weekplanSchema: mongoose.model('weekPlans', weekplanSchema, 'weekPlans'),
  monthplanSchema: mongoose.model('monthPlans', monthplanSchema, 'monthPlans'),
  quarterObjectiveSchema: mongoose.model(
    'quarterObjective',
    quarterObjectiveSchema,
    'quarterObjective'
  ),
  yearObjectiveSchema: mongoose.model(
    'yearObjective',
    yearObjectiveSchema,
    'yearObjective'
  )
}
